<?php

defined('SYSPATH') or die('No direct access allowed.');

/**
 * Service User 
 */
class Model_Service_Vote implements Domain_Dao_Interface_Generic {

    public $_rep;

    /**
     * 
     */
    public function __construct() {

        $this->_rep = Model_Vote::get_instance();
    }

    /**
     *
     * @return <type>
     */
    public function load($id) {
        return $this->_rep->load($id);
    }

    /**
     *
     * @param <type> $offset
     * @param <type> $limit
     * @param <type> $filter
     * @param <type> $sort
     * @param <type> $count
     * @return <type>
     */
    public function load_all($is_count = false, $offset = null, $limit = null, $filter = null, $sort = null) {
        return $this->_rep->load_all($offset, $limit, $filter, $sort, $is_count);
    }

    /**
     *
     * @param Domain_Entities_Entity $o_entity
     * @return <type> 
     */
    public function insert($o_entity) {
        return $this->_rep->insert_by($o_entity);
    }

    /**
     *
     * @param Domain_Entities_Entity $o_entity
     * @return <type>
     */
    public function update($o_entity) {
        return $this->_rep->update_by($o_entity);
    }

    /**
     *
     * @param <type> $id
     * @return <type> 
     */
    public function delete($id) {
        return $this->_rep->delete_by($id);
    }

    public function get($user_id) {
        $this->_rep->clear();
        $this->_rep->builder_select('user_id',array('where'=>'='),$user_id);
        return $this->_rep->query_all();
    }

}

?>
